package it.unisalento.appsalento.adapter;

import it.unisalento.R;
import it.unisalento.appsalento.model.Appello;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class AppelliDettaglioEsameAdapter extends ArrayAdapter<Appello> {

	public AppelliDettaglioEsameAdapter(Context context, int textViewResourceId,
			ArrayList<Appello> objects) {
        super(context, textViewResourceId, objects);
    }
	
	@Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = (LayoutInflater) getContext()
             .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = inflater.inflate(R.layout.row_appello_dettaglio_esame, null);
        TextView mDataProvaScritta = (TextView)convertView.findViewById(R.id.dettaglio_esame_ps);
        TextView mDataProvaOrale = (TextView)convertView.findViewById(R.id.dettaglio_esame_po);
        Appello appello = getItem(position);
        mDataProvaScritta.setText(appello.getDataProvaScritta().toString());
        mDataProvaOrale.setText(appello.getDataProvaOrale().toString());
        return convertView;
    }
}
